import request from '@/utils/request'
import da from "element-ui/src/locale/lang/da";

//获取所有项目
export function reqGetAllItems(){
    return request({
        url: "/getProjectlist",
        method: "get",
    })
}

//查询项目
export function reqConditionSer(pagInfo,data) {
    return request({
        url: "/project/querybyOption/" + pagInfo,
        method: "post",
        data: data
    })
}

//查询Qua项目
export function reqQuaConditionSer(pagInfo,data) {
    return request({
        url: "/project/queryQuabyOption/" + pagInfo,
        method: "post",
        data: data
    })
}

//添加项目
export function reqProjectAdd(data) {
    return request({
        url: "/project/Add",
        method: "post",
        data: data
    })
}

//修改项目
export function reqProjectModify(data) {
    return request({
        url: "/project/edit",
        method: "post",
        data: data
    })
}

//展示未修改前项目内容
export function reqProjectContent(projectId) {
    return request({
        url: "/project/getprojectMeetingById/" + projectId,
        method: "get",
    })
}

//获取公司限额数据
export function reqPurchaseLimit() {
    return request({
        url: "/project/getPurchaseLimit",
        method: "get",
    })
}

//删除项目
export function reqProjectDel(projectId) {
    return request({
        url: "/project/deleteById/" + projectId,
        method: "get",
    })
}

//上传会议纪要
export function uploadFile(data) {
    return request({
        url: "/project/upload",
        method: "post",
        data: data
    })
}

//上传前期资料
export function uploadPrefile(data) {
    return request({
        url: "/project/uploadPreFiles",
        method: "post",
        data: data
    })
}

//获取某个项目采购清单
export function reqPurchaseList(projectId){
    return request({
        url: "/project/showpurchaselist?projectId=" + projectId,
        method: "get",
    })
}

//获取负面关键词清单
export function reqNegativeKeywords(){
    return request({
        url: "/getKeywords",
        method: "get",
    })
}

//购物清单添加
export function reqManageAdd(data) {
    return request({
        url: "/purchaseList/add",
        method: "post",
        data: data
    })
}

//购物清单修改
export function reqManageModify(data) {
    return request({
        url: "/purchaseList/edit",
        method: "post",
        data: data
    })
}

//购物清单删除
export function reqManageDel(id) {
    return request({
        url: "/purchaseList/deleteById/" + id,
        method: "get",
    })
}

//保存
export function reqApproveSave(data) {
    return request({
        url: "/project/saveSupplierQua",
        method: "post",
        data: data
    })
}

//提交审批
export function reqApproveGet(projectId) {
    return request({
        url: "/project/getSupplierQua/" + projectId,
        method: "get",
    })
}
export function reqApproveSubmit(data) {
    return request({
        url: "/project/submitSupplierQua",
        method: "post",
        data: data
    })
}

//关键词查询
export function reqApproveCheck(data) {
    return request({
        url: "/project/checkSupplierQua",
        method: "post",
        data: data,
        dataType: 'json'
    })
}

//供应商资格条件审批主页获取项目列表
export function reqProjectList() {
    return request({
        url: "/getProjectQualist",
        method: "get",
    })
}

//审批通过
export function projectApprove(data) {
    return request({
        url: "/projectQuaPass",
        method: "post",
        data: data
    })
}

//审批退回
export function projectUnapproved(data) {
    return request({
        url: "/projectQuaRollback",
        method: "post",
        data: data
    })
}

//下载会议纪要
export function downloadMeetingMinutes(data) {
    return request({
        url: "/project/downloadMeetingMinutes/" + data,
        responseType: 'arraybuffer',
        method: "get",
    })
}

//下载前期资料
export function downloadPreFile(data) {
    return request({
        url: "/project/downloadPreFiles/" + data,
        responseType: 'arraybuffer',
        method: "get",
    })
}


